﻿using HopeBus.View;
using HopeBus.View.formAdmin;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace HopeBus
{
    public partial class FormTelaPrincipal : Form
    {

        public FormTelaPrincipal()
        {
            InitializeComponent();
        }

        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {

        }

        private void toolStripMenuItem2_Click(object sender, EventArgs e)
        {

        }

        private void toolStripMenuItem3_Click(object sender, EventArgs e)
        {

        }

        private void toolStripMenuItem4_Click(object sender, EventArgs e)
        {

        }

        private void gerarRelatórioToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            //limpa a tela
            
            switch (textBoxUsername.Text)
            {
                case "Adm":
                    panelBackground.Controls.Clear();
                    //instancia uma nova tela e adiciona a mesma dentro do panel da TelaPrincipal
                    FormAdminFuncoes telaAdmin = new FormAdminFuncoes();
                    telaAdmin.TopLevel = false;
                    panelBackground.Controls.Add(telaAdmin);

                    //Tira a barra do topo da tela
                    telaAdmin.FormBorderStyle = FormBorderStyle.None;

                    telaAdmin.Show();
                    break;
                case "Josinaldo":
                    panelBackground.Controls.Clear();
                    FormTelaFuncoes telaVendedor = new FormTelaFuncoes();
                    telaVendedor.TopLevel = false;
                    panelBackground.Controls.Add(telaVendedor);
                    telaVendedor.FormBorderStyle = FormBorderStyle.None;
                    telaVendedor.Show();
                    break;
                
            }
            
        }

        private void textBoxUsername_TextChanged(object sender, EventArgs e)
        {

        }

        private void panelTelaPrincipal_Paint(object sender, PaintEventArgs e)
        {

        }
    }
}
